﻿using BarManager.Core.DomainModel;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;
using System;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace BarManager.Infrastructure.Data.Repository
{
    public class MesaRepository : BaseRepository<Mesa>, IMesaRepository
    {
        public MesaRepository(IObjectContext context)
            : base(context)
        {           
        }

        public override Mesa Get(Expression<Func<Mesa, bool>> condition)
        {
            return base.Context.Query<Mesa>()
                .Include(x => x.Zona)
                .FirstOrDefault(condition);
        }       
    }
}
